<?php
/**
* 功能: 身份通注册接口
* 创建日期:Thu Nov 24 11:14:49 CST 2011
* 最后更新:
* 作者: slash
*/

class soapId5 {

	function soapId5() {
		
	}
	
	function regid5($userName,$idccode,$mobile)
	{
		//return "";
		global $reg_url;
		$client = new SoapClient($reg_url);
		$array['userName'] = $userName;
		$array['idcode'] = $idccode;
		$array['mobilePhone'] = $mobile;
		$array['icpCode'] = ICPCODE;
		$array['icpcodePassWord'] = ICPPASS;
		$array['auth'] = 1010;
		$result=$client->validateByAuth($array);
		//print_r($result);
		$xml = $result->validateByAuthReturn;
		//print_r($xml);

		//$document = empty($xml) ? '123456' :@simplexml_load_string($xml);
		$xml_pj = Factory::getBaseClass('xmltoarray');

		$xml_pj->set_xml($xml);
		$xml = $xml_pj->createArray();
		$document = empty($xml) ? false :$xml['data'];
		//print_r($xml->createArray());
		//$xml_pd = Factory::getBase
		//echo "<br>";
		//print_r($document);exit;
		return $document;
		
	}
	
	function loginid5($sft,$sftpass)
	{
		global $login_url;
		$client = new SoapClient($login_url);

        $array['icpCode'] = LOGINCODE;
        $array['icpPassword'] = LOGINPASS;
		$array['idtagNO'] = $sft;
		$array['password'] = $sftpass;
		$result = $client->remoteLogin($array);
		$xml = $result->remoteLoginReturn;
	
		$xml_pj = Factory::getBaseClass('xmltoarray');

		$xml_pj->set_xml($xml);
		$xml = $xml_pj->createArray();
		$document = empty($xml) ? false :$xml['data'];
		return $document;
		
	}
}
